package svc

import (
	"demo/internal/config"
	"demo/internal/database"

	_ "github.com/lib/pq"
	"github.com/zeromicro/go-zero/core/stores/sqlx"
	"gorm.io/gorm"
)

type ServiceContext struct {
	Config config.Config

	Orm    sqlx.SqlConn

	GormDB  *gorm.DB

	
}

func NewServiceContext(c config.Config) *ServiceContext {
	return &ServiceContext{
		Config: c,
		Orm: sqlx.NewSqlConn("postgres",c.DB.DataSource),
		GormDB: database.NewDB(c.DB.DataSource),

	}
}
